package com.dhcc.DRGsHosp.facade.impl;

import java.util.Map;
import java.util.Properties;

import javax.inject.Named;

import org.openkoala.koala.commons.InvokeResult;

import com.dhcc.DRGsHosp.facade.PropertiesFacade;
import com.dhcc.DRGsHosp.infra.util.PropertiesUtil;

/**
 * @title		:PropertiesFacadeImpl.java
 * @description	:
 * @author		:lileizheng
 * @date		:2016年9月27日
 * @version     :1.0
 * @copyright   :DHCC 2013-2014 
 */
@Named("drgsHospFacadeImpl37")
public class PropertiesFacadeImpl implements PropertiesFacade {

	@Override
	public InvokeResult getProperty(String key) {
		return InvokeResult.success(PropertiesUtil.getProperties("drgs_p.properties", key));
	} 
	
	@Override
	public InvokeResult setProperties(Map<String, String> json) {
		Map<String, String> keyValueMap = json;
		PropertiesUtil.updateProperties("drgs_p.properties", keyValueMap);
		return InvokeResult.success();
	}

	@Override
	public InvokeResult getProperties(String fileName) {
		Properties prop = PropertiesUtil.getProperties(fileName + ".properties");
		return InvokeResult.success(prop);
	}
}
